package com.tpp.baseConsumer.service.impl;

import com.tpp.baseConsumer.mapper.AreaMapper;
import com.tpp.baseConsumer.service.AdminAreaService;
import com.tpp.comm.pojo.TpArea;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AdminAreaServiceImpl implements AdminAreaService {

    @Resource
    private AreaMapper areaMapper;

    @Override
    public List<TpArea> findArea() {
        return areaMapper.selectList(null);
    }

    @Override
    public void addArea(TpArea tpArea) {
        areaMapper.insert(tpArea);
    }

    @Override
    public void updateArea(TpArea tpArea) {
        areaMapper.updateById(tpArea);
    }

    @Override
    public void deleteArea(Long id) {
        areaMapper.deleteById(id);
    }

    @Override
    public TpArea findById(Long id) {
        return areaMapper.selectById(id);
    }
}
